package com.smart.gui;

import java.awt.Font;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.SwingConstants;
import javax.swing.border.EmptyBorder;

import com.jgoodies.forms.factories.FormFactory;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.RowSpec;
import com.smart.core.AppManager.DesiredEnum;

public class Business_Drivers_Part2 extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3086983278941712701L;

	private JPanel contentPane;

	/**
	 * singleton pattern -- getInstance
	 */
	private static Business_Drivers_Part2 uniqueInstanceForm;

	public static synchronized Business_Drivers_Part2 getInstance() {
		if (uniqueInstanceForm == null) {
			try {
				uniqueInstanceForm = new Business_Drivers_Part2();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return uniqueInstanceForm;
	}

	/**
	 * Create the frame.
	 */
	public Business_Drivers_Part2() {
		ButtonHandler handler = new ButtonHandler(this);

		setTitle("Business Drivers Questionnaire -- Part 2");
		setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
		setBounds(25, 25, 427, 518);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane
				.setLayout(new FormLayout(new ColumnSpec[] {
						FormFactory.DEFAULT_COLSPEC,
						ColumnSpec.decode("default:grow"),
						FormFactory.RELATED_GAP_COLSPEC,
						FormFactory.MIN_COLSPEC,
						FormFactory.RELATED_GAP_COLSPEC, }, new RowSpec[] {
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						RowSpec.decode("default:grow"),
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						RowSpec.decode("default:grow"),
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						RowSpec.decode("default:grow"),
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						RowSpec.decode("default:grow"),
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						RowSpec.decode("default:grow"),
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC, }));

		JLabel lblBudgetAndSchedule = new JLabel("Budget and Schedule");
		contentPane.add(lblBudgetAndSchedule, "2, 2");

		JLabel lblDesired = new JLabel("Desirable?");
		contentPane.add(lblDesired, "4, 2");

		JLabel label = new JLabel("1)");
		label.setHorizontalAlignment(SwingConstants.LEFT);
		label.setHorizontalTextPosition(SwingConstants.LEFT);
		contentPane.add(label, "1, 4, left, default");

		JLabel lblWhatIsThe = new JLabel(
				"What is the time frame for the migration?");
		lblWhatIsThe.setHorizontalAlignment(SwingConstants.LEFT);
		lblWhatIsThe.setHorizontalTextPosition(SwingConstants.LEFT);
		contentPane.add(lblWhatIsThe, "2, 4, fill, default");

		JComboBox<DesiredEnum> comboBox = new JComboBox<DesiredEnum>(
				DesiredEnum.values());
		comboBox.setName("comboBox");
		comboBox.setMaximumRowCount(DesiredEnum.values().length);
		comboBox.setEditable(false);
		comboBox.setSelectedItem(DesiredEnum.UNK);
		contentPane.add(comboBox, "4, 4");

		JScrollPane scrollPane = new JScrollPane();
		contentPane.add(scrollPane, "2, 6, 3, 1, fill, fill");

		JTextArea textArea = new JTextArea();
		textArea.setName("textArea");
		textArea.setFont(new Font("Monospaced", Font.PLAIN, 11));
		textArea.setRows(1);
		textArea.setWrapStyleWord(true);
		textArea.setLineWrap(true);
		scrollPane.setViewportView(textArea);

		JLabel label_1 = new JLabel("2)");
		contentPane.add(label_1, "1, 8, left, default");

		JLabel lblWhatIsThe_1 = new JLabel("What is the budget for migration?");
		contentPane.add(lblWhatIsThe_1, "2, 8, fill, default");

		JComboBox<DesiredEnum> comboBox_1 = new JComboBox<DesiredEnum>(
				DesiredEnum.values());
		comboBox_1.setName("comboBox_1");
		comboBox_1.setMaximumRowCount(DesiredEnum.values().length);
		comboBox_1.setEditable(false);
		comboBox_1.setSelectedItem(DesiredEnum.UNK);
		contentPane.add(comboBox_1, "4, 8");

		JScrollPane scrollPane_1 = new JScrollPane();
		contentPane.add(scrollPane_1, "2, 10, 3, 1, fill, fill");

		JTextArea textArea_1 = new JTextArea();
		textArea_1.setName("textArea_1");
		textArea_1.setFont(new Font("Monospaced", Font.PLAIN, 11));
		textArea_1.setRows(1);
		textArea_1.setWrapStyleWord(true);
		textArea_1.setLineWrap(true);
		scrollPane_1.setViewportView(textArea_1);

		JLabel label_2 = new JLabel("3)");
		contentPane.add(label_2, "1, 12");

		JLabel lblWhoIsPaying = new JLabel("Who is paying for the migration?");
		contentPane.add(lblWhoIsPaying, "2, 12");

		JComboBox<DesiredEnum> comboBox_2 = new JComboBox<DesiredEnum>(
				DesiredEnum.values());
		comboBox_2.setName("comboBox_2");
		comboBox_2.setMaximumRowCount(DesiredEnum.values().length);
		comboBox_2.setEditable(false);
		comboBox_2.setSelectedItem(DesiredEnum.UNK);
		contentPane.add(comboBox_2, "4, 12");

		JScrollPane scrollPane_2 = new JScrollPane();
		contentPane.add(scrollPane_2, "2, 14, 3, 1, fill, fill");

		JTextArea textArea_2 = new JTextArea();
		textArea_2.setName("textArea_2");
		textArea_2.setFont(new Font("Monospaced", Font.PLAIN, 11));
		textArea_2.setRows(1);
		textArea_2.setWrapStyleWord(true);
		textArea_2.setLineWrap(true);
		scrollPane_2.setViewportView(textArea_2);

		JLabel label_3 = new JLabel("4)");
		contentPane.add(label_3, "1, 16");

		JLabel lblAreThereAny = new JLabel(
				"Are there any potential for additional resources?");
		contentPane.add(lblAreThereAny, "2, 16");

		JComboBox<DesiredEnum> comboBox_3 = new JComboBox<DesiredEnum>(
				DesiredEnum.values());
		comboBox_3.setName("comboBox_3");
		comboBox_3.setMaximumRowCount(DesiredEnum.values().length);
		comboBox_3.setEditable(false);
		comboBox_3.setSelectedItem(DesiredEnum.UNK);
		contentPane.add(comboBox_3, "4, 16, fill, default");

		JScrollPane scrollPane_3 = new JScrollPane();
		contentPane.add(scrollPane_3, "2, 18, 3, 1, fill, fill");

		JTextArea textArea_3 = new JTextArea();
		textArea_3.setName("textArea_3");
		textArea_3.setRows(1);
		textArea_3.setWrapStyleWord(true);
		textArea_3.setLineWrap(true);
		scrollPane_3.setViewportView(textArea_3);

		JLabel label_4 = new JLabel("5)");
		contentPane.add(label_4, "1, 20");

		JLabel lblAnyConstraintsRelated = new JLabel(
				"Any constraints related to bugdet?");
		contentPane.add(lblAnyConstraintsRelated, "2, 20");

		JComboBox<DesiredEnum> comboBox_4 = new JComboBox<DesiredEnum>(
				DesiredEnum.values());
		comboBox_4.setName("comboBox_4");
		comboBox_4.setMaximumRowCount(DesiredEnum.values().length);
		comboBox_4.setEditable(false);
		comboBox_4.setSelectedItem(DesiredEnum.UNK);
		contentPane.add(comboBox_4, "4, 20, fill, default");

		JScrollPane scrollPane_4 = new JScrollPane();
		contentPane.add(scrollPane_4, "2, 22, 3, 1, fill, fill");

		JTextArea textArea_4 = new JTextArea();
		textArea_4.setName("textArea_4");
		textArea_4.setFont(new Font("Monospaced", Font.PLAIN, 11));
		textArea_4.setRows(1);
		textArea_4.setWrapStyleWord(true);
		textArea_4.setLineWrap(true);
		scrollPane_4.setViewportView(textArea_4);

		JButton btnSave = new JButton("Save");
		btnSave.setActionCommand(ButtonHandler.SAVE);
		btnSave.addActionListener(handler);
		contentPane.add(btnSave, "1, 24, 4, 1");
	}

}
